<style>
	.login_page { width: 100%; height: 400px; display: flex; flex-flow: column nowrap; justify-content: center; align-items: center; }
	.login_page input { width: 300px; height: 32px; margin-top: 20px; }
	.login_page button { width: 120px; height: 32px; margin-top: 20px; }
</style>

<article class="login_page" id="vm">
	<input type="text" name="userName" v-model="userName" placeholder="请输入用户名">
	<input type="password" name="password" v-model="password" placeholder="请输入密码">
	<button class="btn_login" @click="login()">登录</button>
</article>


<script>
	var vm = new Vue({
		el: '#vm',
		data: {
			userName: '', 
			password: ''
		},
		methods: {
			login: function(){
				if(! this.userName || ! this.password) {
					alert('用户名密码不能为空');
					return false;
				} 
<<<<<<< HEAD
				let params = {
					do: 'select', 
					table: 'tj.operation_users', 
					conditions: JSON.stringify({username: this.userName, password: hex_md5(this.password), user_status: 1})
				}
				axios.get(dataDomain + 'login/login', {params: params}).then(function(r){
=======
				let url = dataDomain + 'data/post.php/ksap/login/login'
				console.log('login page post url is: ', url)
				post(url, {"login_name": this.userName, "password": hex_md5(this.password)}, function(r){
>>>>>>> cba9cafd673f42ad5454652a82cea5b5ef9bdc87
					console.log(r);
					if(r.status == 1 && r.data.length > 0){
						window.sessionStorage.setItem('userlogin', JSON.stringify(r.data[0]));
						window.location.reload();
					} else {
						alert("用户名密码有误")
					}
				})
			}
		}, 
		mounted: function(){
			window.sessionStorage.removeItem('userlogin');
		}
	})
	
	
	
</script>